package in.co.codedoc.json.mapper.tests;

import in.co.codedoc.encrypt.HashValue;
import in.co.codedoc.json.JSONObjectValue;
import in.co.codedoc.json.JSONUtil;
import in.co.codedoc.json.JSONValue;
import in.co.codedoc.tests.JUNitTestBase;

import org.junit.Test;

import static org.junit.Assert.assertTrue;

public class HashValueJSONMapperTests
	extends JUNitTestBase
{
	@Test
	public void TestEncodeDecode()
	{
		Foo foo = new Foo();
		foo.SetHv(new HashValue("HashValue"));
		foo.SetOther(32);
		
		Foo decoded 
			= (Foo)JSONUtil.Decode(JSONValue.Decode(JSONUtil.Encode(foo, null).Encode()),Foo.class.getCanonicalName());
		
		assertTrue(decoded.equals(foo));
	}
}
